package cn.com.jenson.web.main.controller;

import cn.com.jenson.common.BasicController;
import cn.com.jenson.common.ImportVerifierVo;
import cn.com.jenson.common.Result;
import cn.com.jenson.common.SelectVo;
import cn.com.jenson.entity.main.Log;
import cn.com.jenson.service.main.service.LogService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/api/main/log")
public class LogController implements BasicController<Log,Log,Log> {

    @Resource
    LogService logService;

    @Override
    public Result<Page<Log>> pageAll(@RequestBody Log log) {
        return Result.suc(logService.pageAll(log));
    }

    @Override
    public Result<List<Log>> listAll(@RequestBody Log log) {
        return Result.suc(logService.listAll(log));
    }

    @Override
    public Result<Log> get(@RequestBody Log log) throws InstantiationException, IllegalAccessException {
        return Result.suc(logService.get(log));
    }

    @Override
    public Result<Log> edit(@RequestBody Log log) throws InstantiationException, IllegalAccessException {
        return Result.suc(logService.edit(log));
    }

    @Override
    public Result<List<Log>> editAll(@RequestBody List<Log> logs) {
        return Result.suc(logService.editAll(logs));
    }

    @Override
    public Result<Log> deleted(@RequestBody Log log) throws InstantiationException, IllegalAccessException {
        return Result.suc(logService.deleted(log));
    }

    @Override
    public Result<List<Log>> deletedAll(@RequestBody List<Log> logs) throws InstantiationException, IllegalAccessException {
        return Result.suc(logService.deletedAll(logs));
    }

    @Override
    public List<ImportVerifierVo> importTemplateVerifiers() {
        return null;
    }

    @Override
    public void importTemplateDownload(HttpServletResponse response) throws IOException {

    }

    @Override
    public Result<List<SelectVo<String, Integer, Log>>> option() {
        return null;
    }
}
